{assign name="$data.attrs.value" value=":empty($data.attrs.value) ? '' : json_encode($data.attrs.value)"}
<div class="np-array-container">
    <input type="hidden"
           {foreach $data.attrs as $key => $attr}
    {$key}='{$attr | raw}'
    {/foreach}
    >
    <div class="np-array"></div>
</div>